with open('data.txt','w',encoding="UTF-8")as file:
    file.write('张三,18,男')
    file.close()